import request from '@/utils/request'

const api = {
  page: '/expertGroup/page',
  expertGroup: '/expertGroup',
  addDeclarationInfo: '/expertDeclarationInfo/add',
  getCurrentDeclarationSystem3: '/declarationSystem/getCurrentDeclarationSystem3'
}

export function getExpert (parameter) {
  return request({
    url: api.page,
    method: 'get',
    params: parameter
  })
}

export function saveExpert (parameter) {
  return request({
    url: api.expertGroup,
    method: parameter.id === 0 ? 'post' : 'put',
    data: parameter
  })
}

export function deleteExpert (parameter) {
  return request({
    url: api.expertGroup + `/${parameter.id}`,
    method: 'delete'
  })
}

export function addDeclarationInfo (parameter) {
  return request({
    url: api.addDeclarationInfo,
    method: 'post',
    data: parameter
  })
}
// 当前 2填报中 3专家评审 4分数公示 体系
export function getCurrentDeclarationSystem3 (parameter) {
  return request({
    url: api.getCurrentDeclarationSystem3,
    method: 'get',
    params: parameter
  })
}
